package cn.tedu.submarine;

import javax.swing.*;

public class BattleShip extends SeaObject {
    private int life;
    public BattleShip() {
        super(66,26,270,124,20);
        life = 5;
    }


    @Override
    public void move() {

    }

    public void moveLeft() {
        x -= speed;
    }
    public void moveRight() {
        x += speed;
    }

    @Override
    public ImageIcon getImage() {
        return Images.battleShip;
    }

    public Bomb shootBomb() {
        return new Bomb(this.x,this.y);
    }

    public void addLife(int num) {
       life += num;
    }

    public void minusLife(int num) {
        life -= num;
    }

    public int getLife() {
        return life;
    }
}
